import * as req from '@/request';

export async function list(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.VpnGroupMonitorList>(
    '/vpnservermonitor/list',
    params,
    sorter,
    filter,
  );
}

// export async function grouplist(
//   params?: { [key: string]: any },
//   sorter?: { [key: string]: any },
//   filter?: { [key: string]: any },
// ) {
//   return req.postForm<API.VpnGroupMonitorList>(
//     '/vpnservermonitor/grouplist',
//     params,
//     sorter,
//     filter,
//   );
// }


export async function groupOnlinelist(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.VpnGroupOnlineList>(
    '/vpnservermonitor/grouponlinelist',
    params,
    sorter,
    filter,
  );
}

// export async function lastGroupOnlinelist(
//   params?: { [key: string]: any },
//   sorter?: { [key: string]: any },
//   filter?: { [key: string]: any },
// ) {
//   return req.postForm<API.VpnGroupOnlineList>(
//     '/vpnservermonitor/lastgrouponlinelist',
//     params,
//     sorter,
//     filter,
//   );
// }

export async function iplist(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.VpnServerOnlineIpList>(
    '/vpnservermonitor/onlineiplist',
    params,
    sorter,
    filter,
  );
}

export async function trafficMonitorList(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.TrafficMonitorList>(
    '/vpnservermonitor/TrafficMonitorList', params
  );
}



export async function getGroupTrafficData(url: string) {
  return req.getCross(url);
}


